package cn.edu.cqvie.jdk8.fun;

import sun.plugin.javascript.navig.Array;

import javax.swing.plaf.synth.SynthTextAreaUI;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;

public class Test1 {


    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
//        System.out.println("------------");
//        for (Integer i : list) {
//            System.out.println(i);
//        }
        System.out.println("------------");

        //lambda
        list.forEach((Integer i) -> {
            System.out.println(i);
        });

        //method reference
        list.forEach(System.out::println);
        System.out.println("------------");

//        System.out.println(Short.MAX_VALUE);
        ;

//        Objects.requireNonNull(null);
//        System.out.println();
    }


}
